<template>
  <div class="share" v-if="item">
    <div
      class="title"
      @click="$router.push('/shareDetail/' + item.id)"
      v-html="item.title"
    ></div>
    <div class="content">
      {{ item.content }}
    </div>
    <div class="other">
      <div class="user">
        <img :src="baseURL + item.author.avatar" alt="" />
        <span>{{ item.author.nickname }}</span>
      </div>
      <div class="time">{{ item.created_at | hmfilter }}</div>
      <div class="comment">
        <i class="iconfont iconicon_pinglunliang"></i
        >{{ item.article_comments }}
      </div>
      <div class="star">
        <i class="iconfont iconbtn_dianzan_small_nor"></i>{{ item.star }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['item'],
  data () {
    return {
      baseURL: process.env.VUE_APP_URL
    }
  }
}
</script>

<style lang="less" scoped>
.share {
  padding: 25px 15px;
  .title {
    font-size: 16px;
    font-weight: 700;
  }
  .content {
    margin-top: 15px;
    font-size: 14px;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .other {
    margin-top: 15px;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #c7c7ce;
    .user {
      display: flex;
      align-items: center;
      flex: 1;
      img {
        width: 22px;
        height: 22px;
        border-radius: 50%;
      }
      span {
        color: #8a8c9d;
        margin-left: 10px;
      }
    }
    .comment {
      margin: 0 15px;
      .iconfont {
        margin-right: 10px;
      }
    }
    .star {
      .iconfont {
        margin-right: 10px;
      }
    }
  }
}
</style>
